package cn.jiyun.dao;

import cn.jiyun.pojo.Student;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface StudentDao extends Mapper<Student> {
    Page<Student> findPage(String queryString);

    void add(Student student);

    @Insert("INSERT INTO `dsx02_parent`.`ts`(`tid`, `sid`) VALUES (#{tid}, #{sid})")
    void addts(@Param("sid") Integer id, @Param("tid") Integer checkitemId);

    @Delete("delete from ts where sid=#{id}")
    void delBySid(Integer id);

    @Select("select tid from ts where sid=#{id}")
    List<Integer> findCheckItemIdsByCheckGroupId(Integer id);
}
